package com.zyyx.classroom.service.impl;

import java.util.List;
import com.zyyx.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zyyx.classroom.mapper.ClassroomMapper;
import com.zyyx.classroom.domain.Classroom;
import com.zyyx.classroom.service.IClassroomService;

/**
 * 教室管理Service业务层处理
 * 
 * @author xxw
 * @date 2025-01-07
 */
@Service
public class ClassroomServiceImpl implements IClassroomService 
{
    @Autowired
    private ClassroomMapper classroomMapper;

    /**
     * 查询教室管理
     * 
     * @param classroomId 教室管理主键
     * @return 教室管理
     */
    @Override
    public Classroom selectClassroomByClassroomId(Long classroomId)
    {
        return classroomMapper.selectClassroomByClassroomId(classroomId);
    }

    /**
     * 查询教室管理列表
     * 
     * @param classroom 教室管理
     * @return 教室管理
     */
    @Override
    public List<Classroom> selectClassroomList(Classroom classroom)
    {
        return classroomMapper.selectClassroomList(classroom);
    }

    /**
     * 新增教室管理
     * 
     * @param classroom 教室管理
     * @return 结果
     */
    @Override
    public int insertClassroom(Classroom classroom)
    {
        classroom.setCreateTime(DateUtils.getNowDate());
        return classroomMapper.insertClassroom(classroom);
    }

    /**
     * 修改教室管理
     * 
     * @param classroom 教室管理
     * @return 结果
     */
    @Override
    public int updateClassroom(Classroom classroom)
    {
        classroom.setUpdateTime(DateUtils.getNowDate());
        return classroomMapper.updateClassroom(classroom);
    }

    /**
     * 批量删除教室管理
     * 
     * @param classroomIds 需要删除的教室管理主键
     * @return 结果
     */
    @Override
    public int deleteClassroomByClassroomIds(Long[] classroomIds)
    {
        return classroomMapper.deleteClassroomByClassroomIds(classroomIds);
    }

    /**
     * 删除教室管理信息
     * 
     * @param classroomId 教室管理主键
     * @return 结果
     */
    @Override
    public int deleteClassroomByClassroomId(Long classroomId)
    {
        return classroomMapper.deleteClassroomByClassroomId(classroomId);
    }
}
